package com.atguigu.retryers;

import feign.RetryableException;
import feign.Retryer;

public class MyReTryer implements Retryer {

    private Integer start = 1;
    private Integer end = 3;

    @Override
    public void continueOrPropagate(RetryableException e) {
        if (start >= end) {
            throw new RuntimeException(e);
        }
        start++;
    }

    @Override
    public Retryer clone() {
        return new MyReTryer();
    }
}
